package com.content.scaffold.model.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author xiaojl
 */

@AllArgsConstructor
@Getter
public enum UserTypeEnum {
    /**
     * 公证处用户
     */
    OFFICE_USER(1, "公证处用户", "1"),
    /**
     * 商家用户
     */
    STORE_USER(2, "商家用户", "10"),
    /**
     * 管理单位用户
     */
    MANAGEMENT_UNIT(3, "管理单位用户", "12"),
    /**
     * 商户协会
     */
    STORE_ASSOCIATION(4, "商户协会", "11");
    private final Integer code;
    private final String desc;
    private final String userType;

    public static UserTypeEnum getUserTypeEnum(String userType) {
        return Arrays.stream(values()).filter(e -> ObjectUtil.equal(e.getUserType(), userType)).findFirst().orElse(null);
    }
}
